package com.woniu51.k15demo.config;

import com.woniu51.k15demo.interceptors.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Arrays;

/**
 * @author 杨光
 * @date 2022年02月17日 11:11
 */
//@Configuration
public class MyWebMvcConfigure implements WebMvcConfigurer {

    @Autowired
    LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor)
                .excludePathPatterns(Arrays.asList("/manager/login","/swagger-ui/"));
    }
}
